package com.world.blog.domain;

import java.math.BigDecimal;

import com.world.common.core.domain.BaseEntity;
import com.world.common.utils.AssertUtil;
import lombok.Data;
import com.world.common.annotation.Excel;

/**
 * 项目对象 blog_project
 * 
 * @author LiJunXi
 * @date 2025-05-25
 */
@Data
public class BlogProject extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 项目ID */
    private Long projectId;

    /** 项目名称 */
    @Excel(name = "项目名称")
    private String title;

    /** 项目介绍 */
    @Excel(name = "项目介绍(md)")
    private String mdContent;

    @Excel(name = "项目介绍(html)")
    private String htmlContent;

    /** 项目封面 */
    @Excel(name = "项目封面")
    private String projectCover;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Long userId;

    /** 视频教程URL */
    @Excel(name = "视频教程URL")
    private String videoUrl;

    /** 项目价格 */
    @Excel(name = "项目价格")
    private BigDecimal price;

    /** 浏览量 */
    @Excel(name = "浏览量")
    private Integer viewsCount;

    /** 在线地址 */
    @Excel(name = "在线地址")
    private String projectUrl;

    /** 支持修改 */
    @Excel(name = "支持修改")
    private Long isUpdate;

    /** 支持部署 */
    @Excel(name = "支持部署")
    private Long isDeploy;

    /** 支持讲解 */
    @Excel(name = "支持讲解")
    private Long isTeach;

    private String nickName;

    private String qq;

    private String wechat;

    public void checkSaveParams() {
        AssertUtil.isNotEmpty(title, "标题不能为空");
        AssertUtil.isNotEmpty(mdContent, "内容不能为空");
        AssertUtil.isNotEmpty(htmlContent, "内容不能为空");
        AssertUtil.isNotEmpty(projectCover, "封面不能为空");
        AssertUtil.isNotEmpty(price, "是否价格不能为空");
        AssertUtil.isNotEmpty(isUpdate, "是否修改不能为空");
        AssertUtil.isNotEmpty(isDeploy, "是否部署不能为空");
        AssertUtil.isNotEmpty(isTeach, "是否讲解不能为空");
    }
}
